package lab2;

public class Test17 {
    public static void main(String[] args) {



    int[] numbers=new int[5];

    numbers[0] =13;
    numbers[1] =20;
    numbers[2] =30;
    numbers[3] =40;
    numbers[4] =50;
//输出所有值
    for (int index=0;index<numbers.length;index++)
    {
        System.out.println(numbers[index]);
    }
    //输出最大值
        for (int i=0;i<numbers.length;i++)

        {
            int max=0;
            if (numbers[i]>max){
                max=numbers[i];
            }
            System.out.println("max is:"+max);
        }
    //求和
        int sum =0;
    for (int i =0;i<numbers.length;i++)
    {
        sum+=numbers[i];
    }
        System.out.println("sum is:"+sum);



    }



    //ctrl+d 复制一行，Ctrl+x 删除一行
}
